<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>游戏交易平台管理系统</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">游戏交易平台管理系统</div>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <dd class="main_left"><a data-src="/data">首页</a>
                </li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">用户管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a data-src="/user/toUser">用户列表</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;">游戏道具管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a data-src="/commodity/toCommodity">游戏道具列表</a></dd>
                        <dd class="main_left"><a data-src="/category/toCategory">游戏道具分类</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;">求购管理</a>
                    <dl class="layui-nav-child">
                        <dd class="main_left"><a data-src="/post/toPost">求购帖子</a></dd>
                    </dl>
                </li>

            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe frameborder="0" scrolling="yes" style="width: 100%" src="/data" id="aa">
        </iframe>
    </div>

    <!--    <div class="layui-footer">-->
    <!--        &lt;!&ndash; 底部固定区域 &ndash;&gt;-->
    <!--        底部固定区域-->
    <!--    </div>-->
</div>
<script src="./layui/layui.js"></script>
<script>

    //JS
    layui.use(['element', 'layer', 'util'], function () {
        var element = layui.element
            , layer = layui.layer
            , util = layui.util
            , $ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function (othis) {
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
            , menuRight: function () {
                layer.open({
                    type: 1
                    , content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
                    , area: ['260px', '100%']
                    , offset: 'rt' //右上角
                    , anim: 5
                    , shadeClose: true
                });
            }

        });
        $(function () {
            //获取src值
            $(".main_left a").on("click", function () {
                var address = $(this).attr("data-src");
                $("iframe").attr("src", address);
            });
            //一下代码是根据窗口高度在设置iframe的高度
            var frame = $("#aa");

            var frameheight = $(window).height();
            console.log(frameheight);
            frame.css("height", frameheight);


        });

    });
</script>
</body>
</html>